﻿<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script type="text/javascript" src="MyString.js"></script>

    <script type="text/javascript" src="XmlObject.js"></script>

    <script type="text/javascript" src="/js/jquery-1.10.2.min.js"></script>

    <link rel="stylesheet" type="text/css" href="default.css" />

    <script language="JavaScript" type="text/javascript">
        window.onload = function() {
            fullmask.style.display = "none";
        }
        function closeDiv() {
            message.style.display = "none";
            window.location = "index.asp"
            return true;
        }
        function closeThisDiv() {
            PublicMsg.style.display = "none";
            return true;
        }
        var afterFunction;
        function setMessage(sTitle, sContent, afterClose) {
            p_msg_title.innerHTML = sTitle;
            p_msg_area.innerHTML = sContent;
            PublicMsg.style.display = "block";
            afterFunction = afterClose;
        }
        function closeMessage() {
            PublicMsg.style.display = "none";
            afterFunction();
            return true;
        }
        function reinit(sID) {
            $.ajax({
                url: "thj.asp",
                data: {
                    Action: "reinit",
                    rid: sID
                },
                success: function(data) {
                    var oData = eval("(" + data + ");");
                    if (oData.msg == 'ok') {
                        setMessage("请求执行结果成功",
                        "返回结果：<b>" + oData.param + "</b>"
                        , function() {
                            parent.window.location = parent.window.location;
                        });
                    }
                    else {
                        setMessage("请求执行结果失败",
                        "返回结果：<b>" + oData.param + "</b>"
                        , function() {
                            parent.window.location = parent.window.location;
                        });
                    }
                }
            });
        }
        function denyit(sID) {
            $.ajax({
                url: "thj.asp",
                data: {
                    Action: "refuse",
                    rid: sID
                },
                success: function(data) {
                    var oData = eval("(" + data + ");");
                    if (oData.msg == 'ok') {
                        setMessage("请求执行结果成功",
                        "返回结果：<b>" + oData.param + "</b>"
                        , function() {
                            parent.window.location = parent.window.location;
                        });
                    }
                    else {
                        setMessage("请求执行结果失败",
                        "返回结果：<b>执行失败！</b>"
                        , function() {
                            window.location = window.location;
                        });
                    }
                }
            });
        }
        function doneit(sID) {
            $.ajax({
                url: "thj.asp",
                data: {
                    Action: "finish",
                    rid: sID
                },
                success: function(data) {
                    var oData = eval("(" + data + ");");
                    if (oData.msg == 'ok') {
                        setMessage("请求执行结果成功",
                        "返回结果：<b>" + oData.param + "</b>"
                        , function() {
                            window.location = window.location;
                        });
                    }
                    else {
                        setMessage("请求执行结果失败",
                        "返回结果：<b>" + oData.param + "</b>"
                        , function() {
                            window.location = window.location;
                        });
                    }
                }
            });
        }
    </script>

    <style type="text/css">
        .style1
        {
            width: 62px;
        }
        .style2
        {
            width: 141px;
        }
        .style3
        {
            width: 70px;
        }
        .connection
        {
            background-color: #FFE8AB;
        }
        td
        {
            padding: 3px;
        }
    </style>
</head>
<body>
    <!-- 信息框层 -->
    <div class="fulldiv" id="fullmask">
    </div>
    <div class="msgdiv" id="PublicMsg">
        <span class="msg_title" id="p_msg_title"></span><span class="close_text" onclick="return closeMessage();">
            <a href="javascript:void(0);">[关闭]</a> </span><span class="msg_content" id="p_msg_area">
            </span>
    </div>
    <!-- 主内容层 -->
    <div>
        <table>
            <tr height="30px;">
                <td>
                    <span class="view_title">预约维修情况详单(客户联)</span>
                    <div class="view_bar">
                    </div>
                </td>
            </tr>
            <tr height="100%">
                <td class="view_content">
                    <%
                    dim rac
                    dim code
                    dim rid,querycode,reqID
                    code=NewRequest("FlowCode")
                    querycode=NewRequest("QueryCode")
                    if isnumeric(code)=false then
                        response.Clear
                        response.End
                    end if
                    set rac=Server.CreateObject("adodb.recordset")
                    rac.open "select * from s_request left join s_accept on s_accept.RequestID=s_request.id where s_request.code='" & code & "' and s_request.querycode='" & querycode & "'",conn,3,3
                        if rac.recordcount>0 then
                            rid=rac("s_request.id")
                            Session("fix_rid")=rid
                    %>
                    <table width="100%" style="border-bottom: 1px dashed"">
                        <tr>
                            <td width="454" valign="top" colspan="4">
                                <p align="center">
                                    维修受理信息</p>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" class="style1">
                                <p>
                                    申请人
                                </p>
                            </td>
                            <td valign="top" class="style2">
                                <p>
                                    <span class="red_text">
                                        <%=rac("sName") %></span>
                                </p>
                            </td>
                            <td valign="top" class="style3">
                                <p>
                                    性别
                                </p>
                            </td>
                            <td width="113" valign="top">
                                <p>
                                    <span class="red_text">
                                        <%
                                        if rac("sex")="boy" then
                                            response.Write("男")
                                        else
                                            response.Write("女")
                                        end if
                                        %>
                                    </span>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" class="style1">
                                <p>
                                    申请编码
                                </p>
                            </td>
                            <td valign="top" class="style2">
                                <p>
                                    <span class="red_text">
                                        <%=rac("code") %>
                                    </span>
                                </p>
                            </td>
                            <td valign="top" class="style3">
                                <p>
                                    受理时间
                                </p>
                            </td>
                            <td width="113" valign="top">
                                <p>
                                    <span class="red_text">
                                    <%if getAcceptID(rid)>0 then %>
                                        <%=formattime(rac("resp_time"),"yyyy-mm-dd") %>
                                    <%else %>
                                        [待处理]
                                    <%end if %>
                                    </span>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" class="style1">
                                <p>
                                    联系方式
                                </p>
                            </td>
                            <td width="340" valign="top" colspan="3">
                                <p>
                                    <span class="red_text">
                                        <%=rac("sPhone") %>
                                    </span>
                                </p>
                            </td>
                        </tr>
                        <%if getAcceptID(rid)>0 then %>
                        <tr class="connection">
                            <td valign="top" class="style1">
                                <p>
                                    承接人</p>
                            </td>
                            <td width="340" valign="top" colspan="3">
                                <p>
                                    <span class="red_text">
                                        <%=GetAdminInfo(rac("resp_boycode"),"ad_name") %></span>
                                </p>
                            </td>
                        </tr>
                        <tr class="connection">
                            <td valign="top" class="style1">
                                <p>
                                    承接人手机</p>
                            </td>
                            <td width="340" valign="top" colspan="3">
                                <p>
                                    <span class="red_text">
                                        <%=GetAdminInfo(rac("resp_boycode"),"ad_phone") %></span>
                                </p>
                            </td>
                        </tr>
                        <% end if %>
                        <tr>
                            <td valign="top" class="style1">
                                <p>
                                    故障描述
                                </p>
                            </td>
                            <td width="340" valign="top" colspan="3">
                                <p>
                                    <label>
                                    </label>
                                    <textarea name="textarea" rows="3" style="width: 100%" disabled="disabled"><%=rac("describe") %></textarea>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" class="style1">
                                <p>
                                    联络地点
                                </p>
                            </td>
                            <td width="340" valign="top" colspan="3">
                                <textarea name="textarea0" cols="20" rows="3" style="width: 100%" disabled="disabled"><%=rac("sPlace") %></textarea>
                            </td>
                        </tr>
                        <tr width="100%" height="50px">
                            <td colspan="4" style="text-align: center;">
                                <%if getRequestField(rid,"state")<>"done" then%>
                                <input type="button" value="自行完成" onclick="doneit('<%=rid%>')" />
                                <%end if %>
                                <%if getRequestField(rid,"state")="refuse" then%>
                                <input type="button" value="再次请求" onclick="reinit('<%=rid%>')" />
                                <%end if %>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <div class="view_processlist">
            <span class="red_text">受理情况明细: </span>
            <%
                dim krs
                set krs=Server.CreateObject("adodb.recordset")
                krs.open "select [StateTime],[State],ByUser from s_activity where ReqID=" & rid & " order by [StateTime] Desc",conn,3,3
                    if krs.recordcount>0 then
                        do while not krs.eof = true
            %>
            <br />
            <span class="view_processlist_datetime">
                <%=formattime(krs("StateTime"),"yyyy-mm-dd hh:MM:ss") %></span> <span class="view_processlist_text">状态：<%=ShowState(krs("State")) %>
                    操作人：<%=GetAdminInfo(krs("ByUser"),"ad_name") %></span>
            <% 
                        krs.movenext
                        loop
                     end if
                krs.close
                set krs=nothing
            %>
        </div>
        <%
        else
        %>
        <span style="color: Red; font-size: 15px;">未查询到信息</span>
        <%
            response.End
        end if 
        rac.close
        set rac=nothing
        
        %>
    </div>
</body>
</html>
